package cn.wolfcode.wolf2w.controller;

import cn.wolfcode.wolf2w.domain.Banner;
import cn.wolfcode.wolf2w.service.IBannerService;
import cn.wolfcode.wolf2w.util.JsonResult;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/index")
public class IndexController {
	@Autowired
	private IBannerService bannerService;

	@GetMapping("/banners/travel")
	public Object bannerTravel(){
		List<Banner> travels = bannerService.getTravels();
		return JsonResult.success(travels);
	}
	@GetMapping("/banners/strategy")
	public Object bannerStrategy(){
		Banner bannerStrategy = bannerService.getStrategy();
		return JsonResult.success(bannerStrategy);
	}

}
